home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
4_0
/
SNDLIST-
/
READ_ME_.(TE
< prev
next >
Wrap
Text File
|
1988-11-10
|
4KB
|
76 lines
Documentation for "SndList" version 1.1 (10-Nov-88)
===================================================
Requirements
------------
The minimum configuration is a Macintosh Plus and System Software 6.0.
Anyhow if "SndList" is started it checks if the "_SndPlay" trap is
implemented and refuses to continue if not. "SndList" is MultiFinder aware.
What you get
------------
"SndList" opens the resource fork of the file you specify, and displays a
scrolling list of all sound resources (resource type 'snd ') it finds. You
can have open up to 5 files at the same time. The windows with the lists
can be moved around on the screen as you like. You can select one ore more
sounds from this list using standard Macintosh selecting techniques
(clicking, shift clicking, option clicking). To play the sounds selected
simply click on the "Play" button in the window, or press "Return" or
"Enter", or double click while selecting the sounds. The sounds are played
by calling the Macintosh toolbox trap "_SndPlay". All types of sound
resources can be played: type 1 (e.g. beep sounds from the System file),
type 2 (e.g. sounds from HyperCard stacks).
There is also a scrollbar like control in the window where you can set the
volume level for the speaker. The default volume level is the one you have
set up using the control panel.
But there is more
-----------------
When I tried to play sound resources using the "_SndPlay" trap, that became
available on my Macintosh Plus starting with System 6.0, I noticed that a
lot of sounds I had on public domain disks would not play at the correct
pitch. So there is a hidden option in "SndList" which enables you to patch
the sound resources. If you press the "Option" key while pressing the
"Play" button (or while double clicking, or pressing "Return" or "Enter") a
modal dialog window appears on top of the sound list window, where you can
modify the sampling rate and the base note of the sound resource. Simply
enter new values in the fields labeled "Sampling rate" or "Base note". You
can also click on the above texts to normalize the sampling rate and the
base note. This means that the sampling rate gets adjusted so that the base
note becomes exactly 60 (middle-C). The formula for doing this is:
Sampling rate = Sampling rate * exp2((60 - Base note)/12)
Base note = 60
E.g. the original sampling rate is 22254.545471, and the base note is 72
(one octave above middle-C), but when you play the sound it's pitch seems
to be too high. Click on the text "Sampling rate" or "Base Note" and the
sampling rate changes to 11127.272736 and the base note to 60. Now the
sound should play ok.
This patching only works for 'sound resources which use the sampled sound
synthesizer, and only for the first sampled sound buffer found in the sound
resource (for type 1 sounds the program looks for the first "bufferCmd"
command, and for type 2 sounds the program looks for the first "soundCmd"
command). For more details about the exact structure of sound resources see
the Sound Manager chapter of Inside Macintosh Volume V.
SndINIT
-------
If you want to have sounds played automatically when the Macintosh is
started up, there is nice way to accomplish this. I have included an INIT
resource in the file "SndINIT". This INIT shows it's icon and then plays
all sound resources from its resource fork. Use ResEdit to put the INIT
resource into the "Sound" cdev file in the system folder. Clear the "no
init" bit of the "Sound" cdev file. Copy the sound resources you want into
the "Sound" cdev. You can test the sounds by simply using "Sound" from the
control panel (but you cannot use these sounds as system beeps). Note: this
works only for System 6.0 or later, if you have a Macintosh Plus (because
the "_SndPlay" trap must be available).